import { defHttp } from '/@/utils/http/axios';
import { ErrorMessageMode } from '/#/axios';

enum Api {
  // 获取用户菜单权限
  resource = '/sys/resource',
}

export function getResource(code = 'Z001', mode: ErrorMessageMode = 'modal') {
  const url = `${Api.resource}/${code}`;
  return defHttp.get(
    { url: url },
    {
      errorMessageMode: mode,
    }
  );
}
